import React from 'react';
import { PreRoutesType, PreMenu } from './types';
import Icon from '../components/Icon';

/**
 * 路由结构
 */
export const preRoutes: PreRoutesType = [
    {
        code: 'login',
    },
    {
        code: 'admin',
        routes: [
            {
                code: 'admin_dashboard',
            },
            {
                code: 'admin_question_create',
            },
            {
                code: 'admin_question_category',
            },
            {
                code: 'admin_question_preview',
            },
            {
                code: 'admin_user_create',
            },
            {
                code: 'admin_user_detail',
            },
            {
                code: 'admin_exam_create',
            },
            {
                code: 'admin_menu_create',
            },
            {
                code: 'admin_exam_edit',
            },
            {
                code: 'admin_exam_detail',
            },
            {
                code: 'admin_grade_manage',
            },
            {
                code: 'admin_student_manage',
            },
            {
                code: 'admin_room_manage',
            },
            {
                code: 'admin_exam_index',
            },
            {
                code: 'admin_topic_create',
            },
            {
                code: 'admin_exam_detial',
            },
            {
                code: 'admin_exam_review',
            },
            {
                code: 'admin_exam_grade',
            },
            {
                code: 'admin_exam_prepare',
            },
        ],
    },
];

/**
 * 菜单结构
 */
export const preMenu: PreMenu = [
    {
        name: '试题管理',
        icon: <Icon name="icon-shitiguanli" />,
        children: [
            {
                code: 'admin_question_create',
            },
            {
                code: 'admin_question_category',
            },
            {
                code: 'admin_question_preview',
            },
        ],
    },
    {
        name: '用户管理',
        icon: <Icon name="icon-yonghuguanli" />,
        children: [
            {
                code: 'admin_user_create',
            },
            {
                code: 'admin_user_detail',
            },
        ],
    },
    {
        name: '考试管理',
        icon: <Icon name="icon-kaoshiguanli-" />,
        children: [
            {
                code: 'admin_exam_create',
            },
            {
                code: 'admin_exam_index',
            },
        ],
    },
    {
        name: '班级管理',
        icon: <Icon name="icon-banjiguanli" />,
        children: [
            {
                code: 'admin_grade_manage',
            },
            {
                code: 'admin_room_manage',
            },
            {
                code: 'admin_student_manage',
            },
        ],
    },
    {
        name: '阅卷管理',
        icon: <Icon name="icon-yuejuan" />,
        children: [
            {
                code: 'admin_exam_prepare',
            },
        ],
    },
];
